import request from '@/utils/request'
// -------------圈主------------
const BASE = "/service/circle/"
// 查询问圈圈主列表
export const getCircleSelectCircleMasterApi = (params) => {

    return request({
        url: `${BASE}selectCircleMaster`,
        method: 'get',
        params
    })
}

// 获取验证码
export const getCircleSelectCircleAmountApi = (params) => {

    return request({
        url: `${BASE}/selectCircleAmount`,
        method: 'get',
        params
    })
}

// 查询问圈圈员列表
export const getselectUserByCircleApi = (params) => {

    return request({
        url: `${BASE}selectUserByCircle`,
        method: 'get',
        params
    })
}

// 踢出问圈
export const getCircleRemoveUserApi = (data) => {

    return request({
        url: `${BASE}removeUser/${data.id}/${data.userId}`,
        method: 'DELETE',

    })
}

// 申请加入圈主
export const getCircleEequestJoinApi = (data) => {
    return request({
        url: `${BASE}requestJoin?phone=${data.phone}`,
        method: 'POST',

    })
}


// 查询用户所加入的圈子
export const getSelectJoinCircleApi = (params) => {
    return request({
        url: `${BASE}selectJoinCircle`,
        method: 'GET',
        params
    })
}


// 查询用户能使用的问圈余额
export const getselectCircleAmountApi = (params) => {
    return request({
        url: `${BASE}selectCircleAmount?myself=${params?.myself}`,
        method: 'GET',
    })
}
// 查询用户能使用的问圈余额
export const getselectCircleInviteJoinApi = (data) => {
    return request({
        url: `${BASE}inviteJoin/${data.id}/${data.phone}`,
        method: 'POST',

    })
}



// 查询用户能使用的问圈余额
export const getExitCircleApi = (data) => {
    return request({
        url: `${BASE}exitCircle/${data.circleId}`,
        method: 'DELETE',

    })
}

// 同意加入
export const getCircleAgreeJoinApi = (data) => {
    return request({
        url: `${BASE}agreeJoin/${data.id}/${data.userId}`,
        method: 'PUT',

    })
}

// 同意加入
export const getCircleRejectJoinApi = (data) => {
    return request({
        url: `${BASE}rejectJoin/${data.id}/${data.userId}`,
        method: 'PUT',

    })
}

// 修改用户默认使用问圈
export const getCircleUpdateDefaultPayApi = (data) => {
    return request({
        url: `${BASE}updateDefaultPay?circleId=${data.circleId}`,
        // url: `${BASE}updateDefaultPay`,

        method: 'PUT',

    })
}

// 查询问圈用户的消费记录,根据用户id
export const getSelectUserOrderApi = (params) => {
    return request({
        url: `${BASE}selectUserOrder`,
        // url: `${BASE}updateDefaultPay`,
        method: 'GET',
        params
    })
}

// 修改渠道专员和商务专员
export const getCommercialEditApi = (data) => {
    return request({
        url: `${BASE}edit`,
        // url: `${BASE}updateDefaultPay`,
        method: 'PUT',
        data
    })
}

// 查询用户的消费记录
export const getCircleSelectUserOrderApi = (params) => {
    return request({
        url: `${BASE}selectUserOrder`,
        // url: `${BASE}updateDefaultPay`,
        method: 'GET',
        params
    })
}

// 获取我的消费记录 /financial/order/userConsumption
export const getOrderUserConsumptionApi = () =>{
    return request({
        url: `/financial/order/userConsumption`,
        method: 'GET',
    })
}

// 获取问圈的详细信息 /service/circle/getCircleId
export const getCircleIdGetInfoApi = (params) =>{
    return request({
        url: `/service/circle/getCircleId`,
        method: 'GET',
        params
    })
}

// 修改问圈的详细信息 （限额） /service/circle/updateQuota
export const updateQuotaGetInfoApi = (data) =>{
    return request({
        url: `/service/circle/updateQuota/${data.circleId}/${data.userId}/${data.quota || null}`,
        method: 'put',
    })
}


//获取我的好友列表
export const getFriendListApi = (params) =>{
    return request({
        url: `/service/friend/list`,
        method: 'GET',
        params
    })
}

//查询邀请列表
export const friendInviteMeApi = (params) =>{
    return request({
        url: `/service/friend/inviteMe`,
        method: 'GET',
        params
    })
}

//根据手机号查询用户信息
export const getUserByPhoneApi = (params) =>{
    return request({
        url: `/system/user/getUserByPhone`,
        method: 'GET',
        params
    })
}

//添加好友
export const addFriendApi = (data) =>{
    return request({
        url: `/service/friend/add?friendId=${data.friendId}`,
        method: 'POST',
    })
}
//接受
export const editFriendApi = (data) =>{
    return request({
        url: `/service/friend/edit`,
        method: 'put',
        data
    })
}

//创建会话
export const imSelectSessionApi = (params) =>{
    return request({
        url: `/service/im/selectSession`,
        method: 'get',
        params
    })
}
